import {createWebHistory, createRouter} from 'vue-router'
// import UserCardVIew from "@/pages/card/UserCardVIew.vue";

// import ViewNull from "@/pages/ViewNull.vue"


const routes = [
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index.vue'),
    },
    {
        path: '/',
        component: () => import('@/views/layout/index.vue'),
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'home',
                component: () => import('@/views/layout/home/index.vue'),
            }, {
                path: 'vipManage',
                name: 'vipManage',
                children: [
                    {
                        path: 'vipList',
                        name: 'vipList',
                        component: () => import('@/views/layout/vipManage/VipList.vue'),
                    }, {
                        path: 'consumerRecords',
                        name: 'consumerRecords',
                        component: () => import('@/views/layout/vipManage/ConsumerRecords.vue'),
                    }, {
                        path: 'integralRecord',
                        name: 'integralRecord',
                        component: () => import('@/views/layout/vipManage/IntegralRecord.vue'),
                    },
                ]
            }, {
                path: 'operatorManageGroup',
                name: 'operatorManageGroup',
                children: [
                    {
                        path: 'operatorManage',
                        name: 'operatorManage',
                        component: () => import('@/views/layout/operatorManageGroup/OperatorManage.vue'),
                    }, {
                        path: 'operationStatistics',
                        name: 'operationStatistics',
                        component: () => import('@/views/layout/operatorManageGroup/OperationStatistics.vue'),
                    },
                ]
            }, {
                path: 'orderManageGroup',
                name: 'orderManageGroup',
                children: [
                    {
                        path: 'orderManage',
                        name: 'orderManage',
                        component: () => import('@/views/layout/orderManageGroup/OrderManage.vue'),
                    }, {
                        path: 'refundManage',
                        name: 'refundManage',
                        component: () => import('@/views/layout/orderManageGroup/RefundManage.vue'),
                    }
                ]
            }, {
                path: 'eventManage',
                name: 'eventManage',
                children: [
                    {
                        path: 'couponManage',
                        name: 'couponManage',
                        component: () => import('@/views/layout/eventManage/CouponManage.vue'),
                    }, {
                        path: 'promotionManage',
                        name: 'promotionManage',
                        component: () => import('@/views/layout/eventManage/PromotionManage.vue'),
                    }
                ]
            }, {
                path: 'advertisingManage',
                name: 'advertisingManage',
                children: [
                    {
                        path: 'imageAdvertisingManage',
                        name: 'imageAdvertisingManage',
                        component: () => import('@/views/layout/advertisingManage/ImageAdvertisingManage.vue'),
                    }, {
                        path: 'advertisingPlacement',
                        name: 'advertisingPlacement',
                        component: () => import('@/views/layout/advertisingManage/AdvertisingPlacement.vue'),
                    }
                ]
            }, {
                path: 'basicData',
                name: 'basicData',
                children: [
                    {
                        path: 'membershipCardConfig',
                        name: 'membershipCardConfig',
                        component: () => import('@/views/layout/basicData/MembershipCardConfig.vue'),
                    }, {
                        path: 'deviceManage',
                        name: 'deviceManage',
                        component: () => import('@/views/layout/basicData/DeviceManage.vue'),
                    }, {
                        path: 'rawMaterialClass',
                        name: 'rawMaterialClass',
                        component: () => import('@/views/layout/basicData/RawMaterialClass.vue'),
                    }, {
                        path: 'rawMaterialConfig',
                        name: 'rawMaterialConfig',
                        component: () => import('@/views/layout/basicData/RawMaterialConfig.vue'),
                    }
                ]
            }, {
                path: 'systemManage',
                name: 'systemManage',
                children: [
                    {
                        path: 'userManage',
                        name: 'userManage',
                        component: () => import('@/views/layout/systemManage/UserManage.vue'),
                    }, {
                        path: 'roleManage',
                        name: 'roleManage',
                        component: () => import('@/views/layout/systemManage/RoleManage.vue'),
                    }, {
                        path: 'dictionaryManage',
                        name: 'dictionaryManage',
                        component: () => import('@/views/layout/systemManage/DictionaryManage.vue'),
                    }, {
                        path: 'logManage',
                        name: 'logManage',
                        component: () => import('@/views/layout/systemManage/LogManage.vue'),
                    }
                ]
            }
        ]
    },
    // {
    //     path: '/404',
    //     name: '404',
    //     component: () => import('@/views/404.vue')
    // }, {
    //     path: '/:pathMatch(.*)',
    //     redirect: '/404',
    // }


    //  百宝箱


    // {
    //     path: '/:pathMatch(.*)',
    //     component: () => import('@/pages/NotFound/index.vue')
    // },
]
const router = createRouter({
    // 路由的模式
    history: createWebHistory(),
    // 路由规则
    routes
})

export default router